#include "sanimationentry.h"
#include "sanimationviewer.h"
#include "spriteeditor.h"

void SAnimationViewer::setAnimation(void * a_entry)
{
	SAnimationEntry * entry = (SAnimationEntry*)a_entry;
	SAnimationViewer * me = (SAnimationViewer*)entry->getParent();
	SpriteEditor * se = (SpriteEditor*)me->getParent()->getParent();
	Sprite * s = se->getSprite();
	int a = s->getAnimationIndex();
	int f = s->getFrameIndex();
	int nextA = entry->getAnimationIndex();
	int nextF = entry->getFrameIndex();
	se->getFrameViewer()->changeFrame(a, f, nextA, nextF);
	se->setDirty(0);
}
